<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/generic/taglibs.jsp"%>
<s:layout-render name="/WEB-INF/jsp/generic/layout.jsp">

	<s:layout-component name="pageContent">
	<div class="content">

		<fieldset>
			<legend><c:choose>
				<c:when test="${ not empty actionBean.q }">Résultats de la recherche "${ actionBean.q }"</c:when>
				<c:otherwise>Membres enregistrés</c:otherwise>
			</c:choose></legend>
			
			<%-- <p><s:form action="${actionBean.url }" focus="first">
				<s:errors field="searchQuery" />
				<s:text name="searchQuery"/> <s:submit name="search">Rechercher</s:submit>
			</s:form></p> --%>
			
			<c:if test="${ not empty actionBean.membersFound.list }">
				<ul>
					<c:forEach items="${actionBean.membersFound.list}" var="member">
						<li>
							<ss:secure roles="${actionBean.roleVisible }">
							<a href="${contextPath}${actionBean.memberDetailUrl}/${member.login.id}"></ss:secure>
							${member.firstName}  ${member.lastName}
							<ss:secure roles="${actionBean.roleVisible }"></a></ss:secure>
						</li>
					</c:forEach>
				</ul>
			</c:if>
			
			<%-- <c:url var="previousPageUrl" value="${thisUrl}">
				<c:param name="p" value="${ actionBean.previousPage }" />
			</c:url>
			<c:url var="nextPageUrl" value="${thisUrl}">
				<c:param name="p" value="${ actionBean.nextPage }" />
			</c:url> --%>
			<p><c:if test="${ actionBean.membersFound.hasPreviousPage }"><a href="${ actionBean.membersFound.previousPageUrl }">Page précédente</a></c:if>
			Page ${ actionBean.membersFound.page } / ${ actionBean.membersFound.pMax }
			<c:if test="${ actionBean.membersFound.hasNextPage }"><a href="${ actionBean.membersFound.nextPageUrl }">Page suivante</a></c:if></p>
			
		</fieldset>
		

	</div>
	</s:layout-component>

</s:layout-render>